<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="cn.itcast.shop.order.vo.OrderItem" table="orderitem">
        <id name="itemid">
            <generator class="native" />
        </id>
        <property name="count" />
        <property name="subtotal" />

        <!-- 关联关系 -->
        <many-to-one name="order" class="cn.itcast.shop.order.vo.Order" column="oid">
        </many-to-one>

        <many-to-one name="product" lazy="false" class="cn.itcast.shop.product.vo.Product" column="pid">
        </many-to-one>
    </class>
</hibernate-mapping>